package models

import (
	"gitee.com/sansaniot/ssiot-core/httpmvc/model"
	"ssadmin/internal/admin/models/query"

	dto "ssadmin/common/query"
)

type SysDataKeep struct {
	AgencyId   string        `json:"agencyId"`
	Keep       int           `json:"keep"`
	CreateTime dto.LocalTime `json:"createTime"`

	model.Model
}

func (SysDataKeep) TableName() string {
	return "sys_data_keep"
}

func (e *SysDataKeep) Generate() interface{} {
	o := *e
	return &o
}

func (e *SysDataKeep) GetByAgencyId(agencyId string) error {
	return e.FindOne(e, dto.MakeCondition(query.SysDataKeepQuery{AgencyIdEq: agencyId}))
}
